<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>自由的留言板</title>
    <script type="text/javascript" src="js/jquery-3.4.1.min.js"></script>
    <link rel="stylesheet" href="js/main.css?t=<%=Math.random() %>" />
    <style>
        #login{display: block; }
        #logout,#see_all,#liuyan,#messbox,#register{display: none;}
    </style>
</head>

<body>
<div id="top">
	<h3>It's extremely dangerous to our precious democracy and freedom</h3>
	<button onclick=change_div("#login")>登陆</button>
	<button onclick=change_div("#register")>注册</button>
	<button onclick=change_div("#liuyan")>留言</button>
	<button onclick=change_div("#see_all")>浏览</button>

	<label>当前用户：</label>
	<label id="user"></label>
	<button id="logout" onclick="logout(this)">注销</button>

</div>
	<div id="login"> <!-- 登陆页面 -->
		<div style="display:inline-block; width: 100px">用户名：</div>
		<input id="lname"><br>

		<div style="display:inline-block; width: 100px">密码：</div>
		<input type="password" id="lpwd"><br>

		<button onclick="login()">登陆</button>
	</div>

	<div id="register"> <!-- 注册页面 -->
		<div style="display:inline-block; width: 100px">用户名：</div>
		<input id="rname"><br>

		<div style="display:inline-block; width: 100px">密码：</div>
		<input type="password" id="rpwd"><br>

		<div style="display:inline-block; width: 100px">确认密码：</div>
		<input type="password" id="rpwd2"><br>

		<button onclick="register()">注册</button>
	</div>

	<div id="liuyan">  <!-- 留言页面 -->
		标题:<input id="ltitle"><br>
		内容: <textarea id="lcontent" required></textarea><br>
		<button onclick="submit('-1')">提交</button>
	</div>

	<div id="see_all">  <!-- 查看页面 -->
		<button onclick=get_new() >刷新</button>
		<div id="main">

		</div>
	</div>

	<div id="messbox">   <!--消息框 -->
		<h1 id="mess"></h1>
		<button onclick="closemess()">关闭</button>
	</div>
</body>
<script src="js/main.js?t=<%=Math.random() %>"></script>
</html>
